from appium import webdriver
class Base():
    def __init__(self):
        acp={
  "platformName": "Android",
  "appium:deviceName": "emulator-5554",
  "appium:automationName": "uiautomator2",
  "appium:appPackage": "com.xiachufang",
  "appium:appActivity": ".activity.home.HomeActivity",
  "appium:noReset": True
}
        self.driver=webdriver.Remote('http://127.0.0.1:4723/wd/hub',acp)
        self.driver.implicitly_wait(30)
    def wingwei(self,loc):
        ele=self.driver.find_element(*loc)
        return ele
    def dingweiwenzi(self,loc):
        ele=self.driver.find_element().text
        return ele
    def jietu(self,loc):
        self.driver.save_screenshot(loc)
    def tuichu(self):
        self.driver.quit()
    def qingqiao(self,a,b):
        self.driver.tap(a,b)
    def huadong(self,a,b,c,d):
        self.driver.swipe(a,b,c,d)
    def xitonganjian(self):
        self.driver.press_keycode(3)
